@extends('layouts.module')

@section('content')
    @include('wechat.text.nav')
    <table class="table mt-3 border">
        <thead>
        <tr>
            <th>ID</th>
            <th>规则名称</th>
            <th>关键词</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        @foreach($texts as $index=>$text )
            <tr>
                <td>{{$text['id']}}</td>
                <td>{{$text->rule->title}}</td>
                <td>
                    @foreach($text->rule->keywords as $keyword)
                        <span class="badge badge-info">
                            {{$keyword->word}}
                        </span>
                    @endforeach
                </td>
                <td>
                    <div class="btn-group btn-group-sm" role="group">
                        <a href="{{route('wechat.text.edit',$text)}}" class="btn btn-info">编辑</a>
                        <btn-del
                            action='{{ route('wechat.rule.destroy',$text->rule) }}'>刪除
                        </btn-del>
                    </div>
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>
    <div>
        {{--        @include('edu::layouts.paginate',['data'=>$lessons])--}}
    </div>
@endsection

